#include<stdio.h>
#include<string.h>
#include<assert.h>
#include<errno.h>
struct S
{
  char a:3;
  char b:4;
  char c:5;
  char d:4;
};

char* my_strstr(const char* str1,const char* str2)
{
  assert(str1!=NULL);
  assert(str2!=NULL);
  const char* cp = str1;
  if(*str2=='\0') return (char*)str1;
  while(*cp!='\0')
  {
    char* p1 = (char*)cp;
    char* p2 = (char*)str2;
    while((*p1!='\0')&&(*p2!='\0')&&(*p1==*p2))
    {
      p1++;
      p2++;
    }
    if(*p2=='\0') return (char*)cp;
    cp++;
  }
  
  return NULL;
}


int main()
{

  char* ret = my_strstr("abccdbcd","bc");
  printf("%s\n",ret);
  char str[40] = "2834754570@qq.com"; 
  
  char str_1[3] = "@.";
  char* token = strtok(str,str_1);
  while(token!=NULL)
  {
    printf("%s\n",token);
    token = strtok(NULL,str_1);
  }
  FILE* pf = fopen("ff.txt","r"); 
  if(pf==NULL)
  {
    //printf("%s\n",strerror(errno));
    perror("fopen");
  }
  //strerror(1);
  //printf("%s\n",strerror(9));
  struct S s1;
  int a = sizeof(s1);
  printf("%d\n",a);

  return 0;
}
